home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Carp.Z / Carp
Encoding:
Text File  |  1998-10-28  |  2.0 KB  |  67 lines

  1.  
  2.  
  3.  
  4.      CCCCaaaarrrrpppp((((3333))))         22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))           CCCCaaaarrrrpppp((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       carp      - warn of errors (from perspective of    caller)
  10.  
  11.       cluck      - warn of errors with    stack backtrace
  12.             (not exported by default)
  13.  
  14.       croak      - die    of errors (from    perspective of caller)
  15.  
  16.       confess - die    of errors with stack backtrace
  17.  
  18.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  19.           use Carp;
  20.           croak "We're outta here!";
  21.  
  22.           use Carp qw(cluck);
  23.           cluck "This is how we got    here!";
  24.  
  25.  
  26.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.       The Carp routines are    useful in your own modules because
  28.       they act like    _d_i_e() or _w_a_r_n(), but report where the error
  29.       was in the code they were called from.  Thus if you have a
  30.       routine _F_o_o()    that has a _c_a_r_p() in it, then the _c_a_r_p() will
  31.       report the error as occurring    where _F_o_o() was    called,    not
  32.       where    _c_a_r_p() was called.
  33.  
  34.       FFFFoooorrrrcccciiiinnnngggg aaaa SSSSttttaaaacccckkkk TTTTrrrraaaacccceeee
  35.  
  36.       As a debugging aid, you can force Carp to treat a croak as a
  37.       confess and a    carp as    a cluck    across _a_l_l modules. In other
  38.       words, force a detailed stack    trace to be given.  This can
  39.       be very helpful when trying to understand why, or from
  40.       where, a warning or error is being generated.
  41.  
  42.       This feature is enabled by 'importing' the non-existant
  43.       symbol 'verbose'. You    would typically    enable it by saying
  44.  
  45.           perl -MCarp=verbose script.pl
  46.  
  47.       or by    including the string MCarp=verbose in the the _P_E_R_L_5_O_P_T
  48.       manpage environment variable.
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.